﻿using System;
using System.BusinessObjects.Data;
using Blazing.BusinessObjects.Locations;

namespace Blazing.BusinessObjects.Contacts
{
    [Serializable]
    public class Contact : DataObject<Contact>
    {
        public virtual int ID
        {
            get { return GetValue<int>("ID"); }
            set
            {
                BeginEdit();
                SetValue("ID", value);
            }
        }

        public virtual string Firstname
        {
            get { return GetValue<string>("Firstname"); }
            set
            {
                BeginEdit();
                SetValue("Firstname", value);
            }
        }

        public virtual string Lastname
        {
            get { return GetValue<string>("Lastname"); }
            set
            {
                BeginEdit();
                SetValue("Lastname", value);
            }
        }

        public virtual string Phone
        {
            get { return GetValue<string>("Phone"); }
            set
            {
                BeginEdit();
                SetValue("Phone", value);
            }
        }

        public virtual string Email
        {
            get { return GetValue<string>("Email"); }
            set
            {
                BeginEdit();
                SetValue("Email", value);
            }
        }

        public virtual Address PostalAddress { get; set; }

        public virtual DateTime RowStamp
        {
            get
            {
                return GetValue<DateTime>("RowStamp");
            }
            set
            {
                SetValue("RowStamp", value);
            }
        }
    }
}
